#include "tests.h"
#include "functions.h"

void testOfPower(const int, const TestX &);
int main() {
	TestX t(0);
	testOfPower(0,t);
}
void testOfPower(const int numberTest, const TestX & TX) {
	int nT = 0;
	Expr a("a");
	Expr b("b");
	Expr c("c");
	Expr d("d");
//--- 		
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(a^0);
		TX.test(e, "1", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a+2)^0);
		TX.test(e, "1", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(0^a);
		TX.test(e, "0", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(0^(a*b+2*a+c));
		TX.test(e,"0",__LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(a^1);
		TX.test(e, "a", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a+5*b*c)^1);
		TX.test(e,"a+5bc",__LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(1^a);
		TX.test(e, "1", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(1^(-a));
		TX.test(e, "1", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((-a)^0);
		TX.test(e, "1", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a+5*b*c)^0);
		TX.test(e, "1", __LINE__, nT);
	}
//--- 		
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(a^3);
		TX.test(e, "a^3", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a+2)^6);
		TX.test(e, "(2+a)^6", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a*c*d)^(-2*d/(-2)));
		TX.test(e, "a^dc^dd^d", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a*b*a*(-a)+(2^a)*a+c));
		TX.test(e,"c+2^aa-a^3b",__LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(a^(b^c));
		TX.test(e, "a^(b^c)", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a^b)^(-c));
		TX.test(e,"a^(-bc)",__LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a^4)*(-b)/((a^2)^2));
		TX.test(e, "-b", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a^2)*(b^2)*a*b);
		TX.test(e, "a^3b^3", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e( ((a*b) ^ 2) * c * (-7) * (a^3) * (b/c) );
		TX.test(e, "-7a^5b^3", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e (((a*(-a)*b)^3)*4*c*(a^3)*(b*3/(2*(-c))));
		TX.test(e, "6a^9b^4", __LINE__, nT);
	}
//---
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a+b*c)^2)*(a+b*(-c)));
		TX.test(e, "(a-bc)(a+bc)^2", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a+b*c)^2)*(a+(-1)*b*(-c))+(a^(-1)));
		TX.test(e, "1/a+(a+bc)^3", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a+b*c)^2)*1/(a+b*(c)));
		TX.test(e, "a+bc", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a+b*c)^2)*(-a+b*(-c)));
		TX.test(e, "(a+bc)^2(-a-bc)", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a * (-2 * (b^(1/(a+3-a)))) * c )^3);
		TX.test(e, "-8a^3bc^3", __LINE__, nT);
	}
  	 if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a*b*c)^3) * c * (1/b)  );
		TX.test(e, "a^3b^2c^4", __LINE__, nT);
	 }
//---
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a-5+b-b-a)^3));
		TX.test(e, "-125", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a-5+b-b-a)^((a*1)/(a*3))));
		TX.test(e, "(-5)^(1/3)", __LINE__, nT);
	}

	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a-5+b-b-a)^0));
		TX.test(e, "1", __LINE__, nT);
	}

	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a-5+b-b-a)^(-3)));
		TX.test(e, "-1/125", __LINE__, nT);
	}

	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a-5+b-b-a)^(-(a*1)/(a*3))));
		TX.test(e, "(-5)^(-1/3)", __LINE__, nT);
	}

	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a-1+b-b-a)^7));
		TX.test(e, "-1", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e(((a-1+b-b-a)^8));
		TX.test(e, "1", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a-1+b-b-a)^(2*a/(a*7)));
		TX.test(e, "(-1)^(2/7)", __LINE__, nT);
	}
//---
/*	
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((a+b-b-a)^(-2*a/(a*7)));
		TX.test(e, "BUG", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((b-b)^(-2));
		TX.test(e, "BUG", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((b-b)^(-a));
		TX.test(e, "BUG", __LINE__, nT);
	}
	if (numberTest == ++nT || numberTest == 0) {
		Expr e((b-b)^(a));
		TX.test(e, "BUG", __LINE__, nT);
	}
*/	
}


